import '@babel/polyfill'
import Vue from 'vue'
import './quasar'
import './config'
import 'normalize.css/normalize.css'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss'

import App from '@/App'
import router from '@/router'
import store from '@/store'

import '@/icons'
import '@/permission'

import components from '@/views/common'
import * as filters from '@/filters'
import { hasPermissionforviews } from '@/utils/permission'
import tdfapp from '@/App'

process.env.VUE_APP_MOCK === 'mock' && require('@src/tdf/mock')
export default tdfapp
// 模块化引入-------------------------------------------------------------------------------------------------------start

import TdfUser from 'tdf-ui-vue-tdfbase/src/tdf-sys/views/user/index'
Vue.use(TdfUser)

import TdfMyself from 'tdf-ui-vue-tdfbase/src/tdf-sys/views/user/myself/index'
Vue.use(TdfMyself)

import TdfRole from 'tdf-ui-vue-tdfbase/src/tdf-sys/views/role/index'
Vue.use(TdfRole)

import TdfDept from 'tdf-ui-vue-tdfbase/src/tdf-sys/views/dept/index'
Vue.use(TdfDept)

import TdfMenu from 'tdf-ui-vue-tdfbase/src/tdf-sys/views/menu/index'
Vue.use(TdfMenu)

import TdfGroup from 'tdf-ui-vue-tdfbase/src/tdf-sys/views/group/index'
Vue.use(TdfGroup)

// import TdfParameter from 'tdf-ui-vue-tdfbase/src/tdf-sys/parameter/index'
// Vue.use(TdfParameter)

import TdfLog from 'tdf-ui-vue-tdfbase/src/tdf-sys/views/logs/index'
Vue.use(TdfLog)

import TdfDictionarytype from 'tdf-ui-vue-tdfbase/src/tdf-sys/views/dictionary-type/index'
Vue.use(TdfDictionarytype)

import TdfMultidictionary from 'tdf-ui-vue-tdfbase/src/tdf-sys/views/dictionary/multiindex'
Vue.use(TdfMultidictionary)

// import TdfSingledictionary from 'tdf-ui-vue-tdfbase/src/tdf-sys/dictionary/singleindex'
// Vue.use(TdfSingledictionary)

// 模块化引入---------------------------------------------------------------------------------------------------------end

Vue.use(Element, {
  size: 'small'
})

// 全局注册组件
Object.keys(components).forEach(key => {
  Vue.component(key, components[key])
})

// 全局注册指令
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false
// 全局注册检测元素权限方法
Vue.prototype.hasPerm = hasPermissionforviews
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
